<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page import="net.tribal.comic.entities.AlterPage" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <title><g:message code="title.alterPage.create.nav"/></title>
    </head>
    <body>
        <div class="navButtonsTop rounded-corners">
			<h1 class="title"><g:message code="title.alterPage.create" args="[page.title]"/></h1>
	    </div>
    
    	<g:uploadForm action="save">
        	<div class="element">
	        	<g:hasErrors bean="${alterPageInstance}">
		            <div class="errors rounded-corners"><g:renderErrors bean="${alterPageInstance}" as="list" /></div>
	            </g:hasErrors>
	            
	            <div class="tableCreate">
	             	<table>
						<tbody>
	                    	<tr>
	                        	<td class="name">
	                            	<label for="title"><g:message code="default.label.title"/>:</label>
	                        	</td>
	                        	<td colspan="5" class="value requiredField ${hasErrors(bean: alterPageInstance, field: 'title', 'errors')}">
	                            	<g:textField class="focus" size="50px" maxlength="50" name="title" value="${fieldValue(bean: alterPageInstance, field: 'title')}" />
	                        	</td>
		                    </tr>
	                     	<tr>
	                  			<td class="name">
	                				<label for="file"><g:message code="default.label.path"/>:</label></td>
	                			<td colspan="5" class="value ${hasErrors(bean: comicInstance, field: 'path', 'errors')}">
	                				<input type="file" name="file"/>
	                			</td>
							</tr>
	                 
	                     	<tr>
		                        <td colspan="6" class="value ${hasErrors(bean: alterPageInstance, field: 'description', 'errors')}">
		                        	<richui:richTextEditor name="description" rows="5" cols="40" value="${alterPageInstance?.description}" width="600"/>
		                        </td>
		                    </tr>
	                    	<tr>
	                        	<td class="name">
	                        		<usr:isAdmin>
	                            		<label for="disabled"><g:message code="default.label.disabled"/>:</label>
	                            	</usr:isAdmin>
	                        	</td>
	                        	<td class="value ${hasErrors(bean: alterPageInstance, field: 'disabled', 'errors')}">
	                        		<usr:isAdmin>
	                            		<g:checkBox name="disabled" value="${alterPageInstance?.disabled}" />
	                            	</usr:isAdmin>
	                        	</td>
	                        	<td class="name">
	                            	<label for="commentable"><g:message code="default.label.commentable"/>:</label>
	                        	</td>
	                        	<td class="value ${hasErrors(bean: alterPageInstance, field: 'commentable', 'errors')}">
	                            	<g:checkBox name="commentable" value="${alterPageInstance?.commentable}" />
	                        	</td>
	                        	<td class="name">
	                            	<label for="rateable"><g:message code="default.label.rateable"/>:</label>
	                        	</td>
	                        	<td class="value ${hasErrors(bean: alterPageInstance, field: 'rateable', 'errors')}">
	                            	<g:checkBox name="rateable" value="${alterPageInstance?.rateable}" />
	                        	</td>
	                    	</tr>
	                	</tbody>
					</table>
	        	</div>
       		</div>

	        <div class="navButtons rounded-corners">
	        	<div class="left">
	        		<g:submitButton name="create" class="save" value="${message(code:'default.button.create')}" />
	        	</div>
				<div class="right">
	        		<g:link controller="page" action="show" id="${page.id}"><g:message code="default.button.back"/></g:link>
	        	</div>
				
				
	        </div>
		        
	       	<g:hiddenField name="page.id" value="${page?.id}" />
	       	<g:hiddenField name="fromId" value="${fromId}" />
		</g:uploadForm>
    </body>
</html>
